package com.example.spring_aop.serviceImpl;

import com.example.spring_aop.service.UserService;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

/**
 * @className: UserServiceImpl
 * @author: 芃
 * @description:
 * @date: 2024/12/30 12:56
 */
@Service
public class UserServiceImpl implements UserService {
    @Override
    public Boolean login(String username, String password) {
/*        int a = 10 / 0;*/
        if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)){
            return false;
        }else if (username.equals("admin") && password.equals("123456")){
            return true;
        }else {
            return false;
        }
    }

    @Override
    public Boolean register(String username, String password) {
        if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)){
            return false;
        }else if (username.equals("admin") && password.equals("123456")){
            return true;
        }else {
            return false;
        }
    }
}
